
import {wallet} from '@/api/chat'

let getWallet = async () => {
  const result = await wallet()
  if (result.isSuccess) {
    let {chatGptToken: token, cny: cn} = result.data
    if(!localStorage.getItem('chatGptToken')) {
      localStorage.setItem('chatGptToken',token)
    }
  }else {
    //如果请求失败则自动递归重新请求
   await getWallet()
  }
}
export { getWallet }